import AboutChild from "./aboutChild"
import Aboutchildx from "./aboutchildx"
import "./about.scss"
import { useState, useRef } from "react"
const About = () => {
    const [count, setCount] = useState(1)
    const childRef = useRef()

    const handleClick = () => {
        childRef.current.changeName()
    }
    return (
        <div className="about">
            <h1>
                这里是父组件
            </h1>
            <AboutChild count={count} onCount={setCount} />
            <Aboutchildx ref={childRef} />
            <button onClick={handleClick}>改变子组件的值</button>

        </div>
    )
}
export default About